package com.test.constant;

/**
 * Created by genghz on 17/6/23.
 */
public enum ErrCode {
    BAD_REQUEST("参数错误", 400),
    UNAUTHORIZED("没有登录", 401),
    FORBIDDEN("禁止访问", 403),
    NOT_FOUND("没有找到", 404),
    NOT_SUPPORT("不支持", 405),
    NOT_ACCEPTABLE("不受理", 406),
    TIMEOUT("超时", 408),
    CONFLICT("资源冲突", 409),
    GONE("资源已删除", 410),
    PRECONDITION_FAILED("前置条件错误", 412),
    NOT_SATISFIABLE("条件不满足", 416),
    EXPECTATION_FAILED("未满足期望值", 417),

    KM_DOWN_ERR("km工作异常", 449),
    TABLE_NO_UNSET_ERR("桌码尚未配置", 448),
    AMOUNT_NOT_MATCH("金额匹配失败", 447),

    INTERNAL_ERR("内部错误", 500),
    OK("OK", 200);

    private String info;
    private int code;

    private ErrCode(String info, int code) {
        this.info = info;
        this.code = code;
    }

    public String info() {
        return info;
    }

    public int code() {
        return code;
    }
}
